/*
 * @Author: chengwenixng
 * @Date: 2021-04-14 19:09:52
 * @LastEditors: g05047
 * @LastEditTime: 2021-04-28 16:43:23
 * @Description: file content
 */
import request from  '@utils/request';
import * as actionTypes from './actionType';
import {message}from 'antd';

//获取所有数据
export const getAllDatStatisticsRequest = (id) => {
    return (dispatch) => {
        request('POST','/api/server/web/rest/order/getAllDatStatistics', {
            cmd: 'getAllDatStatistics',
            type: 'request',
            request: {
                id
            }
        }).then(obj => {
            let res = obj.response;
            if (res.res) {
                let menuList = res.message.menuList
                let ordersInRecentSevenDays = res.message.ordersInRecentSevenDays
                dispatch(getAllBoardDatasUpdateReducer(ordersInRecentSevenDays, menuList))
               
            } else {
                message.error('获取数据失败' + res.exception, 1);
            }
        }).catch(err => console.log(err));
    }
}
const getAllBoardDatasUpdateReducer = (ordersInRecentSevenDays, menuList) => ({
    type: actionTypes.BOARDDATAS,
    ordersInRecentSevenDays,
    menuList
   
})
